//新增商品
const mongoose = require("mongoose");
module.exports = mongoose.model("addgoods", {
  //商品标题
  title: {
    type: String,
    required: true,
  },
  //商品描述
  description: {
    type: String,
    required: true,
  },
  //商品分类
  category: {
    type: String,
    required: true,
  },
  //商品品种
  variety: {
    type: String,
    required: true,
  },
  //商品规格
  specifications: {
    type: String,
    require: true,
  },
  //存储条件
  storageCondition: {
    type: String,
    require: true,
  },
  //商品现价
  currentPrice: {
    type: String,
    require: true,
  },
  //商品原价
  originalPrice: {
    type: String,
    require: true,
  },
  //是否推荐
  recommended: {
    type: String,
    default: "否",
  },
  //推荐理由
  recommendationReason: {
    type: String,
  },
  //商品状态
  state: {
    type: String,
    default: "已上架",
  },
  //商品照片
  photos: {
    type: String,
    require: true,
  },
  //是否限时抢购
  flashSale: {
    type: Boolean,
  },
  //抢购价
  snappingPrice: {
    type: Number,
  },
  //是否绿卡优惠
  preferential: {
    type: Boolean,
  },
  //绿卡优惠价  
  preferentialPrice: {
    type:Number
  }
});
